package com.ruoyi.sea.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.sea.domain.SeaValueDay;
import com.ruoyi.sea.mapper.SeaValueDayMapper;
import com.ruoyi.sea.service.ISeaValueDayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 按日统计Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-07
 */
@Service
public class SeaValueDayServiceImpl implements ISeaValueDayService {
    @Autowired
    private SeaValueDayMapper seaValueDayMapper;


    @Override
    public List<SeaValueDay> selectSeaValueDay30(String deviceCode) {
        return seaValueDayMapper.selectSeaValueDay30(deviceCode);
    }

    /**
     * 查询按日统计
     *
     * @param id 水质按日统计主键
     * @return 水质按日统计
     */
    @Override
    public SeaValueDay selectSeaValueDayById(Long id) {
        return seaValueDayMapper.selectSeaValueDayById(id);
    }

    /**
     * 查询按日统计列表
     *
     * @param seaValueDay 水质按日统计
     * @return 水质按日统计
     */
    @Override
    public List<SeaValueDay> selectSeaValueDayList(SeaValueDay seaValueDay) {
        return seaValueDayMapper.selectSeaValueDayList(seaValueDay);
    }

    /**
     * 新增按日统计
     *
     * @param seaValueDay 水质按日统计
     * @return 结果
     */
    @Override
    public int insertSeaValueDay(SeaValueDay seaValueDay) {
        seaValueDay.setCreateTime(DateUtils.getNowDate());
        return seaValueDayMapper.insertSeaValueDay(seaValueDay);
    }

    /**
     * 修改按日统计
     *
     * @param seaValueDay 水质按日统计
     * @return 结果
     */
    @Override
    public int updateSeaValueDay(SeaValueDay seaValueDay) {
        seaValueDay.setUpdateTime(DateUtils.getNowDate());
        return seaValueDayMapper.updateSeaValueDay(seaValueDay);
    }

    /**
     * 批量删除按日统计
     *
     * @param ids 需要删除的水质按日统计主键
     * @return 结果
     */
    @Override
    public int deleteSeaValueDayByIds(Long[] ids) {
        return seaValueDayMapper.deleteSeaValueDayByIds(ids);
    }

    /**
     * 删除按日统计信息
     *
     * @param id 按日统计主键
     * @return 结果
     */
    @Override
    public int deleteSeaValueDayById(Long id) {
        return seaValueDayMapper.deleteSeaValueDayById(id);
    }

    @Override
    public List<SeaValueDay> selectSeaValueDaySeven(String deviceCode) {
        return seaValueDayMapper.selectSeaValueDaySeven(deviceCode);
    }
}